/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package elearning.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Sieu
 */
@Entity
@Table(name = "toeic_full_test_history")
@NamedQueries({
    @NamedQuery(name = "ToeicFullTestHistory.findAll", query = "SELECT t FROM ToeicFullTestHistory t")})
public class ToeicFullTestHistory implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @JoinColumn(name = "TOEIC_ANSWER_ID", referencedColumnName = "ID")
    @ManyToOne
    private ToeicAnswer toeicAnswerId;
    @JoinColumn(name = "TOEIC_QUESTION_ID", referencedColumnName = "ID")
    @ManyToOne
    private ToeicQuestion toeicQuestionId;
    @JoinColumn(name = "TOEIC_EXERCISE_ID", referencedColumnName = "ID")
    @ManyToOne
    private ToeicExercise toeicExerciseId;
    @JoinColumn(name = "TOEIC_CATEGORY_ID", referencedColumnName = "ID")
    @ManyToOne
    private ToeicCategory toeicCategoryId;
    @JoinColumn(name = "TOEIC_LEVEL_ID", referencedColumnName = "ID")
    @ManyToOne
    private ToeicLevel toeicLevelId;
    @JoinColumn(name = "USER_ID", referencedColumnName = "ID")
    @ManyToOne
    private User userId;

    public ToeicFullTestHistory() {
    }

    public ToeicFullTestHistory(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public ToeicAnswer getToeicAnswerId() {
        return toeicAnswerId;
    }

    public void setToeicAnswerId(ToeicAnswer toeicAnswerId) {
        this.toeicAnswerId = toeicAnswerId;
    }

    public ToeicQuestion getToeicQuestionId() {
        return toeicQuestionId;
    }

    public void setToeicQuestionId(ToeicQuestion toeicQuestionId) {
        this.toeicQuestionId = toeicQuestionId;
    }

    public ToeicExercise getToeicExerciseId() {
        return toeicExerciseId;
    }

    public void setToeicExerciseId(ToeicExercise toeicExerciseId) {
        this.toeicExerciseId = toeicExerciseId;
    }

    public ToeicCategory getToeicCategoryId() {
        return toeicCategoryId;
    }

    public void setToeicCategoryId(ToeicCategory toeicCategoryId) {
        this.toeicCategoryId = toeicCategoryId;
    }

    public ToeicLevel getToeicLevelId() {
        return toeicLevelId;
    }

    public void setToeicLevelId(ToeicLevel toeicLevelId) {
        this.toeicLevelId = toeicLevelId;
    }

    public User getUserId() {
        return userId;
    }

    public void setUserId(User userId) {
        this.userId = userId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ToeicFullTestHistory)) {
            return false;
        }
        ToeicFullTestHistory other = (ToeicFullTestHistory) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "elearning.model.ToeicFullTestHistory[ id=" + id + " ]";
    }
    
}
